package com.cookbook.cookbookservice.common.exception;

import lombok.Getter;

/**
 * @program: mid-tourism-service
 * @ClassName BaseExceptionEnum
 * @description:
 * @author: MiaoChao
 * @create: 2024-02-28 23:12
 * @Version 1.0
 **/
@Getter
public enum BaseExceptionEnum {

    // 10000-19999 通用错误
    SAVE_ERROR(10000, "保存失败"),
    SAVE_BATCH_ERROR(10000, "批量保存失败"),
    UPDATE_ERROR(10001, "更新失败"),
    DELETE_ERROR(10002, "删除失败"),
    NOT_EXIST_ERROR(10003, "不存在"),
    QUERY_ERROR(10004, "查询失败"),
    ;

    /**
     * 错误码
     */
    private final Integer code;

    // 错误描述
    private final String message;

    BaseExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}